<template>
  <div>
    <!-- 头部组件 -->
    <!-- <tou-bu></tou-bu> -->
    <!-- logo组件 -->
    <my-headtu></my-headtu>
    <!-- 选项卡 -->
    <my-tabs :pm="it"  :rm='itt' ></my-tabs>
    <!-- <hao-pin :pm="it"></hao-pin> -->
  </div>
</template>
<script>
// import myHead from'';
import haoPin from "../components/haoPin.vue";
import touBu from'../components/myhead';
import myHeadtu from'../components/myhead-tu.vue';
import myTabs from'../components/homeCom/Tabs.vue';
// import dibuTable from'../components/dibuTable.vue';
export default {
  components: {
    haoPin,
    touBu,
    myHeadtu,
    myTabs
    // dibuTable
  },
  data(){
    return{
      it:null,// 热映电影
      itt:null//热映电影列表
    }
  },
  methods:{
    //热门电影数据
   async pm(){
       let re = await this.axios.get("index/topRatedMovies").catch(err=>{
      console.log(err);
    })
    // console.log(re);
    sessionStorage.setItem('shuJu',JSON.stringify(re));
    this.it =re.data.movieList
    // console.log(this.it);
    
    },
    //热门电影列表
    async reYin(){
        let re = await this.axios.get("index/movieOnInfoList").catch(err=>{
          // console.log(err);
        })
        // console.log(re.data.movieList);
        this.itt = re.data.movieList


    }
  },
  created(){
    this.reYin()

    
    // 判断本地储存
if (typeof sessionStorage.shuJu == "undefined") {

    this.pm()
   // console.log("没有");

  } else {

  //  console.log("有 执行本地");

    let re = JSON.parse(sessionStorage.getItem('shuJu')) 
     this.it =re.data.movieList
    // console.log(this.it);
  }

  }
};
</script>
<style lang="less" scoped>
    /deep/ .boxss{
      // background-color: rosybrown ;
    }
</style>